package com.goods.controller;

import com.goods.pojo.User;
import com.goods.service.LoginService;
import com.goods.tool.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {
    @Autowired
    private LoginService loginService;
    @PostMapping("/login")
    public Result login(@RequestBody User user){
        Result login = loginService.login(user);
        return login;
    }

    @PostMapping("/regist")
    public Result regist(@RequestBody User user){
        return loginService.regist(user);
    }
}
